#pragma once

#ifndef _CARMORITEM_H_
#define _CARMORITEM_H_

// Item types for m_type
#define ARMOR_NORMAL		0x40
#define ARMOR_ENCHANTED		0x41
#define ARMOR_AUGMENTED		0x42

// Item types from database
#define DB_SLOTHEAD			1
#define DB_SLOTBODY			2
#define DB_SLOTHANDS		3
#define DB_SLOTLEGS			4
#define DB_SLOTFEET			5
#define DB_SLOTOFFHAND		7  //Shields
#define DB_SLOTNECK			9
#define DB_SLOTWAIST		10
#define DB_SLOTEAR			11
#define DB_SLOTRING			13
#define DB_SLOTBACK			15

#include <vector>

class CSemaphore;
class CModifier;

#include "CItem.h"

class CArmorItem : public CItem
{
public:
		
	CArmorItem(unsigned short itemID);
	~CArmorItem(void);

	void loadStats();
	void loadModifiers();
	void loadAdditionModifiers();

	void setModelId(unsigned short modelID);
	unsigned short getModelId();

	void setSubModelId(unsigned short subModelID);
	unsigned short getSubModelId();

	void setReqLvl(unsigned char type);
	unsigned char getReqLvl();

	void setEquipSlotId(unsigned char equipSlotID);
	unsigned char getEquipSlotId();

	void setRemoveSlotId(unsigned char removeSlotID);
	unsigned char getRemoveSlotId();

	void addMod(unsigned char modifier, char amount);
	char getModAmount(unsigned char modifier);

	void setDefense(char defense);
	char getDefense();

private:

	unsigned char m_reqLvl;
	unsigned short m_modelID;
	unsigned short m_subModelID;

	unsigned char m_equipSlotID;
	unsigned char m_removeSlotID;

	// Can be -128 to 128
	char m_defense;

	//MODIFIERS
	std::vector<CModifier *> modList;
	//modifier list semaphore
	CSemaphore * modListSemaphore;
	//locks modifier list
	void lockModifierList(void);
	//Unlocks modifier list
	void unlockModifierList(void);
};

#endif